const usermodle = require('../../modle/user')
const { Op } = require('sequelize')
module.exports = {
    async getuser(offset, limit, phone, name) {
        return await usermodle.findAndCountAll({
            where: {
                name: {
                    [Op.like]: `%${name}%`
                },
                phone: {
                    [Op.like]: `%${phone}%`
                }
            },
            limit,
            offset: (offset - 1) * limit,
        })
    },
    async deleusers(id) {
        return await usermodle.destroy({
            where: {
                id
            }
        })
    }
}